<template>
    <div>
        <h2>添加作者</h2>
        <p>作者姓名：<input type="text" v-model="name"></p>
        <button @click="addauthor()">添加</button>    
    </div>    
</template>

<script>
import {addauthor} from "../axios_api/api.js"
export default {
    name:"addauthor",
    data() {
        return {
            name:""
        }
    },
    methods:{
        addauthor(){
            var data = {"name":this.name}
            addauthor(data).then(res=>{
                console.log(res)
            })
        }
    }
}
</script>

<style>

</style>
